﻿using BootstrapBlazor.Components;
using BootstrapBlazorApp.Shared.Data.SYS.Base;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BootstrapBlazorApp.Shared.Data.SYS
{
    public class UserDto :BaseDto
    {
       

        /// <summary>
        /// 账号
        /// </summary>
        [Display(Name = "账号")]
        [AutoGenerateColumn(IsReadonlyWhenEdit = true, Searchable= true, Filterable = true)]
        [Required(ErrorMessage = "账号名称不能为空")]
        public string? Account { get; set; }

        /// <summary>
        /// 姓名不能为空
        /// </summary>
        [Display(Name = "姓名")]
        [Required(ErrorMessage = "姓名不能为空")]
        [AutoGenerateColumn(Searchable = true, Filterable = true)]
        public string? Name { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Display(Name = "密码")]
        [Required(ErrorMessage = "密码不能为空")]
        [AutoGenerateColumn(Visible = false, ComponentType = typeof(BootstrapPassword))]
        public string? Password { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [Display(Name = "确认密码")]
        [Required(ErrorMessage = "确认密码不能为空"), Compare(nameof(Password), ErrorMessage = "两次密码不一致")]
        [AutoGenerateColumn(Visible=false,ComponentType = typeof(BootstrapPassword))]
        public string? Confirm { get; set; }


    }
}
